﻿using System;
using UnityEngine;

namespace UniRx.Triggers
{
	// Token: 0x02000441 RID: 1089
	[DisallowMultipleComponent]
	public class ObservableStateMachineTrigger : StateMachineBehaviour
	{
		// Token: 0x060016D9 RID: 5849 RVA: 0x0006275C File Offset: 0x00060B5C
		public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
		{
			if (this.onStateExit != null)
			{
				this.onStateExit.OnNext(new ObservableStateMachineTrigger.OnStateInfo(animator, stateInfo, layerIndex));
			}
		}

		// Token: 0x060016DA RID: 5850 RVA: 0x0006277C File Offset: 0x00060B7C
		public IObservable<ObservableStateMachineTrigger.OnStateInfo> OnStateExitAsObservable()
		{
			Subject<ObservableStateMachineTrigger.OnStateInfo> result;
			if ((result = this.onStateExit) == null)
			{
				result = (this.onStateExit = new Subject<ObservableStateMachineTrigger.OnStateInfo>());
			}
			return result;
		}

		// Token: 0x060016DB RID: 5851 RVA: 0x000627A4 File Offset: 0x00060BA4
		public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
		{
			if (this.onStateEnter != null)
			{
				this.onStateEnter.OnNext(new ObservableStateMachineTrigger.OnStateInfo(animator, stateInfo, layerIndex));
			}
		}

		// Token: 0x060016DC RID: 5852 RVA: 0x000627C4 File Offset: 0x00060BC4
		public IObservable<ObservableStateMachineTrigger.OnStateInfo> OnStateEnterAsObservable()
		{
			Subject<ObservableStateMachineTrigger.OnStateInfo> result;
			if ((result = this.onStateEnter) == null)
			{
				result = (this.onStateEnter = new Subject<ObservableStateMachineTrigger.OnStateInfo>());
			}
			return result;
		}

		// Token: 0x060016DD RID: 5853 RVA: 0x000627EC File Offset: 0x00060BEC
		public override void OnStateIK(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
		{
			if (this.onStateIK != null)
			{
				this.onStateIK.OnNext(new ObservableStateMachineTrigger.OnStateInfo(animator, stateInfo, layerIndex));
			}
		}

		// Token: 0x060016DE RID: 5854 RVA: 0x0006280C File Offset: 0x00060C0C
		public IObservable<ObservableStateMachineTrigger.OnStateInfo> OnStateIKAsObservable()
		{
			Subject<ObservableStateMachineTrigger.OnStateInfo> result;
			if ((result = this.onStateIK) == null)
			{
				result = (this.onStateIK = new Subject<ObservableStateMachineTrigger.OnStateInfo>());
			}
			return result;
		}

		// Token: 0x060016DF RID: 5855 RVA: 0x00062834 File Offset: 0x00060C34
		public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
		{
			if (this.onStateUpdate != null)
			{
				this.onStateUpdate.OnNext(new ObservableStateMachineTrigger.OnStateInfo(animator, stateInfo, layerIndex));
			}
		}

		// Token: 0x060016E0 RID: 5856 RVA: 0x00062854 File Offset: 0x00060C54
		public IObservable<ObservableStateMachineTrigger.OnStateInfo> OnStateUpdateAsObservable()
		{
			Subject<ObservableStateMachineTrigger.OnStateInfo> result;
			if ((result = this.onStateUpdate) == null)
			{
				result = (this.onStateUpdate = new Subject<ObservableStateMachineTrigger.OnStateInfo>());
			}
			return result;
		}

		// Token: 0x060016E1 RID: 5857 RVA: 0x0006287C File Offset: 0x00060C7C
		public override void OnStateMachineEnter(Animator animator, int stateMachinePathHash)
		{
			if (this.onStateMachineEnter != null)
			{
				this.onStateMachineEnter.OnNext(new ObservableStateMachineTrigger.OnStateMachineInfo(animator, stateMachinePathHash));
			}
		}

		// Token: 0x060016E2 RID: 5858 RVA: 0x0006289C File Offset: 0x00060C9C
		public IObservable<ObservableStateMachineTrigger.OnStateMachineInfo> OnStateMachineEnterAsObservable()
		{
			Subject<ObservableStateMachineTrigger.OnStateMachineInfo> result;
			if ((result = this.onStateMachineEnter) == null)
			{
				result = (this.onStateMachineEnter = new Subject<ObservableStateMachineTrigger.OnStateMachineInfo>());
			}
			return result;
		}

		// Token: 0x060016E3 RID: 5859 RVA: 0x000628C4 File Offset: 0x00060CC4
		public override void OnStateMachineExit(Animator animator, int stateMachinePathHash)
		{
			if (this.onStateMachineExit != null)
			{
				this.onStateMachineExit.OnNext(new ObservableStateMachineTrigger.OnStateMachineInfo(animator, stateMachinePathHash));
			}
		}

		// Token: 0x060016E4 RID: 5860 RVA: 0x000628E4 File Offset: 0x00060CE4
		public IObservable<ObservableStateMachineTrigger.OnStateMachineInfo> OnStateMachineExitAsObservable()
		{
			Subject<ObservableStateMachineTrigger.OnStateMachineInfo> result;
			if ((result = this.onStateMachineExit) == null)
			{
				result = (this.onStateMachineExit = new Subject<ObservableStateMachineTrigger.OnStateMachineInfo>());
			}
			return result;
		}

		// Token: 0x04000CC3 RID: 3267
		private Subject<ObservableStateMachineTrigger.OnStateInfo> onStateExit;

		// Token: 0x04000CC4 RID: 3268
		private Subject<ObservableStateMachineTrigger.OnStateInfo> onStateEnter;

		// Token: 0x04000CC5 RID: 3269
		private Subject<ObservableStateMachineTrigger.OnStateInfo> onStateIK;

		// Token: 0x04000CC6 RID: 3270
		private Subject<ObservableStateMachineTrigger.OnStateInfo> onStateUpdate;

		// Token: 0x04000CC7 RID: 3271
		private Subject<ObservableStateMachineTrigger.OnStateMachineInfo> onStateMachineEnter;

		// Token: 0x04000CC8 RID: 3272
		private Subject<ObservableStateMachineTrigger.OnStateMachineInfo> onStateMachineExit;

		// Token: 0x02000442 RID: 1090
		public class OnStateInfo
		{
			// Token: 0x060016E5 RID: 5861 RVA: 0x0006290C File Offset: 0x00060D0C
			public OnStateInfo(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
			{
				this.Animator = animator;
				this.StateInfo = stateInfo;
				this.LayerIndex = layerIndex;
			}

			// Token: 0x170001C5 RID: 453
			// (get) Token: 0x060016E6 RID: 5862 RVA: 0x00062929 File Offset: 0x00060D29
			// (set) Token: 0x060016E7 RID: 5863 RVA: 0x00062931 File Offset: 0x00060D31
			public Animator Animator { get; private set; }

			// Token: 0x170001C6 RID: 454
			// (get) Token: 0x060016E8 RID: 5864 RVA: 0x0006293A File Offset: 0x00060D3A
			// (set) Token: 0x060016E9 RID: 5865 RVA: 0x00062942 File Offset: 0x00060D42
			public AnimatorStateInfo StateInfo { get; private set; }

			// Token: 0x170001C7 RID: 455
			// (get) Token: 0x060016EA RID: 5866 RVA: 0x0006294B File Offset: 0x00060D4B
			// (set) Token: 0x060016EB RID: 5867 RVA: 0x00062953 File Offset: 0x00060D53
			public int LayerIndex { get; private set; }
		}

		// Token: 0x02000443 RID: 1091
		public class OnStateMachineInfo
		{
			// Token: 0x060016EC RID: 5868 RVA: 0x0006295C File Offset: 0x00060D5C
			public OnStateMachineInfo(Animator animator, int stateMachinePathHash)
			{
				this.Animator = animator;
				this.StateMachinePathHash = stateMachinePathHash;
			}

			// Token: 0x170001C8 RID: 456
			// (get) Token: 0x060016ED RID: 5869 RVA: 0x00062972 File Offset: 0x00060D72
			// (set) Token: 0x060016EE RID: 5870 RVA: 0x0006297A File Offset: 0x00060D7A
			public Animator Animator { get; private set; }

			// Token: 0x170001C9 RID: 457
			// (get) Token: 0x060016EF RID: 5871 RVA: 0x00062983 File Offset: 0x00060D83
			// (set) Token: 0x060016F0 RID: 5872 RVA: 0x0006298B File Offset: 0x00060D8B
			public int StateMachinePathHash { get; private set; }
		}
	}
}
